﻿using FluentNHibernate.Mapping;
using Lokad.Monitoring.Persistence.Entities;

namespace Lokad.Monitoring.Persistence.Mappings
{
    public class ReportMap : ClassMap<Report>
    {
        public ReportMap()
        {
            Id(x => x.Id);
            Map(x => x.Endpoints).Length(4000).Not.Nullable();
            Map(x => x.IndicatorFaultTags).Length(4000);
            Map(x => x.IndicatorMinusTags).Length(4000);
            Map(x => x.IndicatorPlusTags).Length(4000);
            Map(x => x.MessageMinusTags).Length(4000);
            Map(x => x.MessagePlusTags).Length(4000);
            Map(x => x.MessageFaultTags).Length(4000);
            Map(x => x.TimePlotSettings).Length(4000);
            Map(x => x.IsFault).Not.Nullable();
            Map(x => x.MaxDays).Not.Nullable();
            Map(x => x.Data).Length(200000000).LazyLoad();
            Map(x => x.LastRefreshed);
        }
    }
}
